Skip to content

v0.7.1#19

Merged
nman98 merged 17 commits into
Cogwheel-Validator:mainfrom
nman98:main
Jun 24, 2026
Merged

v0.7.1#19
nman98 merged 17 commits into
Cogwheel-Validator:mainfrom
nman98:main

Conversation

@nman98

@nman98 nman98 commented Jun 24, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added support for multisend and new auth session message types throughout transaction handling, indexing, and database storage.
    • Expanded transaction details to include session-related fields and multi-recipient send entries.
    • Added broader signer lookup for blocks.
  • Bug Fixes

    • Fixed several missing-data and address extraction issues for new message types.
    • Improved transaction processing and database setup consistency, including path/config corrections.
  • Chores

    • Updated changelog generation and refreshed dependency versions.

nman98 added 14 commits June 22, 2026 09:48
Add authentication types to the decoder.

Also the process messages has been moved to a seperate file process.go.
Add new table schemas for the database.

Also added the missing spend period in the indexer/decoder/process.go
Add methods to convert from decoded, to database types.
Moved the functions to converter.go file.
Add insert methods and have added missing AllowPath on the create
session message type.
The data processor had to handle a bit of data transfer from one type
to another. Adding 4 new types makes adding even more new data types
harder as the chain grows. So some of the functionality will fall
upon the decoder.
Fixed the session key since it expected to find a session_key_raw.
The session key is identical to regular address so it will be inserted
as a regular address.
Add missing Allow Paths to the auth create session schema.
Add handlers and sql queries for the new message types.
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nman98, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 18 minutes and 31 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 368f21eb-8774-418d-9146-f1c5751eaa58

📥 Commits

Reviewing files that changed from the base of the PR and between 5a96412 and b0b6ca7.

📒 Files selected for processing (8)
  • .github/workflows/govulncheck.yml
  • api/handlers/transactions.go
  • api/huma-types/transaction.go
  • cliff.toml
  • indexer/cli/setup.go
  • indexer/decoder/convert.go
  • indexer/decoder/process.go
  • pkgs/sql_data_types/hypertables.go
📝 Walkthrough

Walkthrough

Adds support for bank_msg_multi_send and three auth session message types (create_session, revoke_session, revoke_all_sessions) across the full indexer stack. The decoder is split into separate process.go and convert.go files. New types, TimescaleDB hypertables, COPY inserters, query methods, data processor inserters, and API response builders are added for each new message variant.

Changes

Auth Session & Multi-Send Message Support

Layer / File(s) Summary
New data type contracts
pkgs/database/types.go, pkgs/sql_data_types/hypertables.go, api/huma-types/transaction.go
Defines MultiSendEntry, BankMultiSendRow, MsgAuthCrSession/RvSession/RvAllSessions DB row types; adds hypertable-mapped structs with table/column/address methods; expands TransactionMessage with Inputs, Outputs, SessionKey, ExpiresAt, SpendLimit, and SpendPeriod fields.
Decoder refactor: process.go, convert.go, product.go
indexer/decoder/decoder.go, indexer/decoder/process.go, indexer/decoder/convert.go, indexer/decoder/product.go
Removes per-type dispatch from decoder.go into process.go (bank/VM/auth message map builders) and convert.go (converter struct mapping msgMaps to DB structs). Extends DbMessageGroups with auth fields, Merge(), AddressEntry, AllAddressEntries(), and refactors ConvertToDbMessages() to use the converter. Adds fatal log on decode failure.
TimescaleDB insertion and hypertable registration
pkgs/database/timescaledb/insert.go, indexer/cli/setup.go
Adds three COPY-based batch inserters for auth session message types. Registers new hypertables for MsgMultiSend and the three auth session tables with weekly chunking and message_counter segment-by.
TimescaleDB query methods and GetAllBlockSigners relocation
pkgs/database/timescaledb/query_msg.go, pkgs/database/timescaledb/query_block.go
Adds GetBankMultiSend, GetMsgAuthCrSession, GetMsgAuthRvSession, and GetMsgAuthRvAllSessions query methods. Moves GetAllBlockSigners from query_msg.go to query_block.go with pgx.ErrNoRows handling.
Data processor: Database interface, inserters, operator refactor
indexer/data_processor/types.go, indexer/data_processor/operator.go, indexer/data_processor/operator_test.go
Extends Database interface with three auth insertion methods; adds msgAuthCr/RvSession/RvAllSessionsInserter implementations. Refactors ProcessMessages to use Merge(), centralizes insertion via allInserters loop, and updates createAddressTx to use AllAddressEntries().
API handler: interface, response builders, mocks
api/handlers/interface.go, api/handlers/transactions.go, api/handlers/database_test.go
Adds four new methods to TransactionDbHandler. Refactors existing response helpers from pointer-to-map to map-by-value signature. Adds getBankMultiSendResponse (aggregating Inputs/Outputs) and three auth session response helpers. Extends MockDatabase with matching fields and mock query methods.
Dependency bump, changelog config, and CHANGELOG entry
go.mod, cliff.toml, CHANGELOG.md
Bumps github.com/gnolang/gno to a newer pseudo-version; adds indirect dependencies. Updates cliff.toml to subject-only commit rendering. Adds the v0.7.1 changelog section.

Sequence Diagram(s)

sequenceDiagram
  participant TX as Raw Transaction
  participant process.go as process.go
  participant convert.go as convert.go
  participant product.go as DbMessageGroups
  participant operator.go as DataProcessor
  participant insert.go as TimescaleDB Insert
  participant query_msg.go as TimescaleDB Query
  participant transactions.go as API Handler

  TX->>process.go: processMsgs(tx, messages) — dispatch by concrete type
  process.go-->>product.go: messages[i] map[string]any (bank/vm/auth)
  product.go->>convert.go: cvt.toMsgAuthCrSession / toMsgMultiSend / ...
  convert.go-->>product.go: dataTypes.MsgAuth* / MsgMultiSend structs
  product.go->>product.go: Merge() into aggregatedDbGroups
  product.go->>operator.go: AllAddressEntries() for address tx building
  operator.go->>insert.go: InsertMsgAuthCrSession / InsertMsgAuthRvSession / InsertMsgAuthRvAllSessions
  query_msg.go->>transactions.go: GetBankMultiSend / GetMsgAuthCrSession / GetMsgAuthRvSession / GetMsgAuthRvAllSessions
  transactions.go-->>transactions.go: getBankMultiSendResponse / getMsgAuthCrSessionResponse
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Cogwheel-Validator/spectra-gnoland-indexer#11: Introduced GetTransactionMessage with the map[int16]TransactionMessage response pattern that this PR refactors (pointer-to-map → map-by-value) and extends with multi-send and auth session helpers.
  • Cogwheel-Validator/spectra-gnoland-indexer#14: Introduced the TransactionDbHandler interface and per-message-type helper structure that this PR directly extends with four new method signatures.
  • Cogwheel-Validator/spectra-gnoland-indexer#15: Introduced MsgMultiSend / DbMessageGroups wiring in the decoder and operator pipeline that this PR builds on by adding auth session variants and the Merge() / AllAddressEntries() helpers.

Poem

🐇 Hop, hop through the session gate,
Multi-send and auth — the pipeline's great!
Converter splits what decoder once held,
New hypertables, inserters, queries felled.
The rabbit stamps v0.7.1 with glee,
Each message type decoded — finally free! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is just a version label and does not describe the main change in the pull request. Use a concise, descriptive title that summarizes the main update, such as adding multisend and auth session support for v0.7.1.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api/handlers/transactions.go`:
- Around line 489-507: The auth create-session response mapping is dropping the
AllowPaths field returned by GetMsgAuthCrSession, so clients never receive that
indexed data. Update the TransactionMessage shape in humatypes and the mapper in
transactions.go so the loop that builds response[index] copies d.AllowPaths
through alongside the other session fields. Keep the API response model and this
conversion logic in sync, using GetMsgAuthCrSession and TransactionMessage as
the key symbols to update.

In `@api/huma-types/transaction.go`:
- Around line 57-61: The public create-session contract is missing the
allow_paths permission field, so add it to TransactionMessage alongside the
existing auth message fields. Update the TransactionMessage struct in
huma-types/transaction.go to include an allow_paths field with the same shape
used by auth_msg_create_session persistence/querying, and ensure its JSON/doc
tags match the API contract so the session response can return this data.

In `@cliff.toml`:
- Line 5: The preview command in the cliff configuration uses an incorrect tag
format with an extra dot, so update the tag value in the preview command to
match the intended pattern. Fix the tag string in the commented git cliff
example so it uses the correct `v0.7.1` form, preserving the existing preview
command structure and related configuration around the cliff.toml preview
setting.

In `@indexer/cli/setup.go`:
- Around line 252-257: Remove the duplicate sdt.MsgMultiSend registration in the
hypertable setup list so CreateHypertableFromStruct is only invoked once for
bank_msg_multi_send. Keep the existing entry in the setup slice and delete the
newly added one in the same block near the dbinit.HypertableParams definitions,
since the duplicate TableName() causes redundant setup and can fail if the call
is not idempotent.

In `@indexer/decoder/convert.go`:
- Around line 255-266: The MsgAddPackage builder is dropping the pkg_file_names
data during conversion, which causes add-package rows to lose their file list.
Update the converter logic in the MsgAddPackage construction path (and the
matching run-package builder referenced by the same refactor) to pass through
the decoded pkg_file_names field into the dataTypes.MsgAddPackage struct so the
DB column stays populated. Keep the change aligned with the existing decoder
fields and the struct’s PkgFileNames member.

In `@indexer/decoder/process.go`:
- Around line 232-238: Normalize the revoke-session message shape in process.go
so it matches the other auth path. In the code that builds the auth message map
for auth_msg_revoke_session, use the same string form for the session key as the
existing session/message helpers expect, instead of storing session_key_raw as
bytes. Update the map keys and any downstream use in toMsgRvSession() so
pre-resolution and parsing consume session_key consistently.

In `@indexer/decoder/product.go`:
- Around line 27-29: The per-message decode failure in NewDecodedMsg should not
call Fatal() and terminate the worker. Change the error handling in product.go
so the decode error is returned to the caller instead of exiting the process,
and let the message-processing loop or batch-level handler decide how to log or
skip the bad transaction. Keep the fix focused on the NewDecodedMsg path and its
caller so a single malformed tx cannot take down the entire indexer.

In `@pkgs/sql_data_types/hypertables.go`:
- Around line 581-585: The auth-session address helpers are omitting
signer-to-tx links because `GetAllAddresses()` only adds creator/session key
addresses, while `AllAddressEntries()` relies on it to build `address_tx`.
Update the `GetAllAddresses()` implementations for the auth-session message
types (including `MsgAuthCrSession` and the other affected methods in the diff)
to also add the persisted `Signers` entries to the returned `TxAddresses`, so
signer relations are included alongside the existing addresses.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d52076b7-b449-45a2-a25f-42c24136d5d9

📥 Commits

Reviewing files that changed from the base of the PR and between a04c48c and 5a96412.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (20)
  • CHANGELOG.md
  • api/handlers/database_test.go
  • api/handlers/interface.go
  • api/handlers/transactions.go
  • api/huma-types/transaction.go
  • cliff.toml
  • go.mod
  • indexer/cli/setup.go
  • indexer/data_processor/operator.go
  • indexer/data_processor/operator_test.go
  • indexer/data_processor/types.go
  • indexer/decoder/convert.go
  • indexer/decoder/decoder.go
  • indexer/decoder/process.go
  • indexer/decoder/product.go
  • pkgs/database/timescaledb/insert.go
  • pkgs/database/timescaledb/query_block.go
  • pkgs/database/timescaledb/query_msg.go
  • pkgs/database/types.go
  • pkgs/sql_data_types/hypertables.go
💤 Files with no reviewable changes (1)
  • indexer/decoder/decoder.go

Comment thread api/handlers/transactions.go
Comment thread api/huma-types/transaction.go
Comment thread cliff.toml Outdated
Comment thread indexer/cli/setup.go
Comment thread indexer/decoder/convert.go
Comment thread indexer/decoder/process.go
Comment on lines +27 to 29
// It should never happen, but we need some way to halt the program.
l.Fatal().Stack().Msgf("failed to decode message %s", err)
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Don't terminate the whole indexer on one decode failure.

Line 28 turns a per-transaction decode error into a process exit. Since NewDecodedMsg() is called from the message-processing loop, one malformed or newly unsupported tx can now take down the whole worker instead of being reported upstream and handled at batch scope.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@indexer/decoder/product.go` around lines 27 - 29, The per-message decode
failure in NewDecodedMsg should not call Fatal() and terminate the worker.
Change the error handling in product.go so the decode error is returned to the
caller instead of exiting the process, and let the message-processing loop or
batch-level handler decide how to log or skip the bad transaction. Keep the fix
focused on the NewDecodedMsg path and its caller so a single malformed tx cannot
take down the entire indexer.

Comment thread pkgs/sql_data_types/hypertables.go
@nman98 nman98 merged commit 212d856 into Cogwheel-Validator:main Jun 24, 2026
5 of 8 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
5.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@coderabbitai coderabbitai Bot mentioned this pull request Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant